package sfin.swt.util;

import java.io.InputStream;
import java.util.Properties;

public class ApplicationUtil {

	private Properties properties;
	
	public static final String NAME = "name";
	public static final String VERSION = "version";
	public static final String ARCH = "arch";
	public static final String LICENCE_LINK = "licenceLink";
	
	public ApplicationUtil() {
		
		try{
			InputStream resourceAsStream = this.getClass().getResourceAsStream("/application.properties");
			Properties prop = new Properties();
			prop.load( resourceAsStream );
			this.properties = prop;
		}catch(Exception e){

		}
	}
	
	public String getVersion() {
		return properties.getProperty(VERSION);
	}
	
	public String getName() {
		return properties.getProperty(NAME);
	}
	
	public String getArch() {
		return properties.getProperty(ARCH);
	}
	
	public String get(String property){
		return this.properties.getProperty(property);
	}

}